 <% provide(:title, (t 'admin.orderdetail')) %> 
 <div class="span9">
  <h3 class="header-title"><%=(t 'admin.orderdetail')%> - <%= @order.created_at.strftime("%H:%M %d-%m-%Y") %></h3>
  <div class="popover-content">
    <% if @detail.empty? %>
    <p><%=(t 'ordercart.empty')%></p>
    <% end %>

    <% total = 0 %>
    <table class="table cart" id="yourcart">
      <tr>
        <th></th>
        <th><%=(t 'name')%></th>
        <th><%=(t 'price')%></th>
        <th><%=(t 'ordercart.quantity')%></th>
        <th><%=(t 'ordercart.total')%></th>
      </tr>

      <% @detail.each do | rec | %>
      <% item = Products.find_by_id(rec.product_id) %>
      <tr>
        <td>
          <div class="image">
            <%= link_to (image_tag item.imageurl), item %>
          </div>
        </td>
        <td><%= link_to item.name, item %></td>
        <td><%= number_to_currency(item.price, :unit => "") %> <%= item.currency %></td>
        <td><%= rec.qrt %><br /></td>
        <td><b>
          <%= number_to_currency(rec.qrt * item.price, :unit => "") %> $</b>
        </td>
      </tr>
      <% total += rec.qrt * item.price %>
      <% end %>

      <tr>
        <td colspan="4">
          <div class="total"><%=(t 'ordercart.total')%>:</div>
        </td>
        <td>
          <div class="price"><%= number_to_currency(total, :unit => "") %> $</div>
        </td>
      </tr>
    </table>
<%= link_to (t 'btnallorder'), "/order",{:class => "btn btn-info"} %>
  </div>
  <div style="clear:both"></div>
</div>